﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<MyVoteMVC.Web.Models.Stat>>" %>

<%= Html.Telerik().Chart<Stat>(Model)
    .Name("Chart" + (string)ViewData["QuestionNo"])
    .Theme("Black")
    .Title((string)ViewData["QuestionTitle"])
    .Legend(legend => legend
        .Position(ChartLegendPosition.Bottom)
    )
    .SeriesDefaults(series =>
        series.Bar().Stack(true).Labels(labels => labels.Visible(true).Format("{0}票"))
    )
    .Series(series =>
    {
        series.Bar(s => s.Online_Count).Name("在线");
        series.Bar(s => s.Offline_Count).Name("离线");
    })
    .CategoryAxis(axis => axis
        .Categories(s => s.Title)
    )
    .ValueAxis(axis => axis
        .Numeric().Labels(labels => labels.Format("{0}票"))
    )
        .HtmlAttributes(new { style = "width: 100%;height:" + (Model.Count() * 75).ToString() + "px;" })
    %>
